
//Namespace
package com.katujo.squirrel.annotations;

//Java imports
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * The squirrel table pattern annotation. Tells the squirrel what pattern
 * to use for class name to table name mapping. 
 * <p>
 * This can only be used on a SquirrelManager extended class. If you want
 * to set the table name of class to be persisted use the Table annotation 
 * which will override this pattern. 
 * </p>
 * <p>
 * If this annotation is not set it will default to the JAVA pattern. 
 * </p>
 * 
 * <br/><br/>
 * Copyright 2010 Katujo LTD<br/>
 * Licensed under the Apache License, Version 2.0<br/>
 * (the "License"); you may not use this file except in compliance with the License. You may<br/>
 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required <br/>
 * by applicable law or agreed to in writing, software distributed under the License is distributed <br/>
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either <br/>
 * express or implied. See the License for the specific language governing permissions and <br/>
 * limitations under the License. <br/>
 * 
 * @author Johan Hertz
 *
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface TablePattern
{
	/**
	 * The pattern for table names.
	 */
	public enum Pattern
	{		
		/**
		 * Use the java class name without any changes. 
		 */
		JAVA,
				
		/**
		 * Change all characters to upper case and inserts underscore 
		 * to separate words.
		 * <p>
		 *  SomeClass => SOME_CLASS
		 * </p>
		 */
		UPPER_CASE,
		
		/**
		 * Change all characters to lower case and inserts underscore 
		 * to separate words.
		 * <p>
		 *  SomeClass => some_class
		 * </p>
		 */
		LOWER_CASE		
	}
	
	/**
	 * The pattern for class name to table name;
	 * @return
	 */
	Pattern pattern();

}
